﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EbayAccountFee.aspx.cs" Inherits="UI_Bas_EbayAccountFee" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>ebay费用管理</title>
    <link href="../../css/admin.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../../js/jquery.easyui/themes/icon.css" rel="stylesheet" type="text/css" />
    <script src="../../js/jquery.easyui/jquery.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/jquery.easyui.min.js" type="text/javascript"></script>
    <script src="../../js/jquery.easyui/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>  
    <script type ="text/javascript" >

        $(function() {
            $("#ddlebayUserId").combobox({
                editable: false
            });

            var defaultDate = Date.parse('1900/01/01');
            var _$ebayaccountfee = $("#ebayaccountfee");
            _$ebayaccountfee.datagrid({
                border: true,
                height: 345,
                title: 'ebay费用列表...',
                remoteSort: false,
                nowrap: true,
                striped: false,
                url: "../../TableHanders.aspx?act=q&tid=04&type=0",
                sortName: 'RefNumber',
                sortOrder: 'desc',
                loadMsg: "正在加载,请稍后...",

                frozenColumns: [[
	                { title: 'EbayUserId', field: 'EbayUserId', width: 85, sortable: true },
	                { title: 'RefNumber', field: 'RefNumber', width: 100, sortable: true }
				  ]],
                columns: [[
				    { field: 'OrderLineItemID', title: 'OrderLineItemID', width: 200, sortable: true },
	                { title: 'TransactionID', field: 'TransactionID', width: 100, sortable: true },
	                { title: 'ItemID', field: 'ItemID', width: 120, sortable: true },
					{ field: 'Title', title: 'Title', width: 400, sortable: true },
	                { title: 'Memo', field: 'Memo', width: 300, sortable: true },
	                { title: 'AccountDetailsEntryType', field: 'AccountDetailsEntryType', width: 150, sortable: true },
	                { title: 'Description', field: 'Description', width: 110, sortable: true },
	                { title: 'CurrencyID', field: 'CurrencyID', width: 80, sortable: true },
	                { title: 'Balance', field: 'Balance', width: 60, sortable: true, align: 'right' },
	                { title: 'CreateDate', field: 'CreateDate', width: 120, sortable: true, formatter: function(val) {
	                    var d = Date.parse(val.replace("-", "/"));
	                    if (d == defaultDate) {
	                        return "";
	                    }
	                    else {
	                        return val;
	                    }
	                }
	                },
	                { title: 'GrossDetailAmount', field: 'GrossDetailAmount', width: 110, sortable: true, align: 'right' },
	                { title: 'NetDetailAmount', field: 'NetDetailAmount', width: 100, sortable: true, align: 'right' },
	                { title: 'VATPercent', field: 'VATPercent', width: 80, sortable: true, align: 'right' }
				]],
                pagination: true,
                rownumbers: true,
                singleSelect: true,
                pageList: [10, 15, 20],
                onDblClickRow: function(rowIndex, rowData) {
                    var id = rowData.RefNumber;
                    var id2 = rowData.EbayUserId;
                    window.showModalDialog("EbayAccountFeeDetail.aspx?act=view&id=" + id + "&id2=" + id2 + "&ts=" + new Date().getTime(), "", "dialogHeight:500px;dialogWidth:780px;edge:Raised;center:Yes;help:No;resizable:no;status:no; scroll:no;location=no;");
                },
                queryParams: {
                    "timeFrom":$("#dateFrom").datebox('getValue'),
                    "timeTo":$("#dateTo").datebox('getValue'),
                    "ebayUserId": $("#ddlebayUserId").combobox('getValue'),
                    "OrderLineItemId": $("#txtOrderLineItemId").val()
                }
            });
            $("#btnQuery").click(function() {
                if (!$("#divContent").form('validate'))
                    return;
                var timeFrom = $('#dateFrom').datebox('getValue');
                var timeTo = $("#dateTo").datebox('getValue');
                var ebayUserId = $("#ddlebayUserId").combobox('getValue');
                _$ebayaccountfee.datagrid({
                    queryParams: {
                        "timeFrom": timeFrom,
                        "timeTo": timeTo,
                        "ebayUserId": ebayUserId,
                        "OrderLineItemId": $("#txtOrderLineItemId").val()
                    }
                });
            });
            $('#dateFrom').datebox({ formatter: function(date) {
                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                var d = date.getDate();
                return y + "-" + m + "-" + d;
            }
            });
            $('#dateTo').datebox({ formatter: function(date) {
                var y = date.getFullYear();
                var m = date.getMonth() + 1;
                var d = date.getDate();
                return y + "-" + m + "-" + d;
            }
            });
        });        
	</script>	
</head>
<body> 
  <div class="div_Title">
        <span class="Body_Title">》》<%=this.Title %></span>
  </div>
  <div id="divContent" class="easyui-panel" title="请输入查询条件..." style="margin-bottom:5px;">      
    <form id="formQuery" runat="server">        
       <table>
             <tr>     
                <td>OrderLineItemId:</td>    
                <td>
                     <input ID="txtOrderLineItemId" runat="server" style="width:213px;"/>
                </td>                       
                <td>帐 号:</td>    
                <td>
                     <select ID="ddlebayUserId" runat="server" style="width:150px;" enableviewstate=false ></select>
                </td>                        
                <td>创建日期:</td>
                <td>
                    <input type ="text" id ="dateFrom" runat="server" style ="width :80px;" class ="easyui-datebox" readonly="readonly"  />                                                     
                </td>
                <td> - </td>
                <td>
                   <input type ="text" ID="dateTo"  runat="server"  style ="width :80px" class ="easyui-datebox" readonly ="readonly" />       
                </td>                                                         
                <td>
                     <a id="btnQuery"  href ="#"  class="easyui-linkbutton" icon="icon-search" >Query</a>                     
                </td>
             </tr>                
         </table>  
       </form>     
    </div>
    <div  id="divData" style ="margin-top :5px;">
       <table  id="ebayaccountfee"></table>
    </div>    
</body>
</html>